Skip to content

Conversation

@achingbrain
Copy link
Contributor

This is a follow-up to #248 that just adds the juice_mux_stop_listen function to juice.h in order to invoke it from libdatachannel.

This is a follow-up to paullouisageneau#248 that just adds the `juice_mux_stop_listen`
function to `juice.h` in order to invoke it from libdatachannel.
@achingbrain achingbrain force-pushed the feat/expose-mux-stop-listen branch from f012414 to 9953b7a Compare January 14, 2025 14:10
return get_mode_entry(agent)->get_addrs_func(agent, records, size);
}

static int juice_mux_stop_listen(const char *bind_address, int local_port) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did this need to be static? juice_mux_listen is not static so I removed it from here otherwise it doesn't compile.

@achingbrain
Copy link
Contributor Author

Or, actually yeah - we can call juice_mux_listen(host.c_str(), port, NULL, NULL) to unbind the callback. Please feel free to close if you don't want to expose the explicit method.

@paullouisageneau
Copy link
Owner

Or, actually yeah - we can call juice_mux_listen(host.c_str(), port, NULL, NULL) to unbind the callback. Please feel free to close if you don't want to expose the explicit method.

Indeed, I preferred not to expose such a function in #248 (comment) because it looks quite clumsy and misleading to me (It ignores its parameters and doesn't actually stop listening on the port). @xicilion kept it as a local function rather than cleaning it up, that's why it is static. You can indeed unregister the callback with juice_mux_listen(host, port, NULL, NULL).

@achingbrain achingbrain deleted the feat/expose-mux-stop-listen branch February 10, 2025 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants